import { MENU_CODES, METHOD_TYPE, MODULES } from '@/options';
import { Result } from '@/types/common/request';
import { request } from '@umijs/max';

const ApiUrl = `/${MODULES.MICRO}/${MENU_CODES.OSS}`;

/** 上传文件 */
export async function setUpload(data: FormData, options?: { [key: string]: any }) {
  return request<Result<string>>(ApiUrl + '/file', {
    method: METHOD_TYPE.POST,
    data,
    ...(options || {}),
  });
}
